package com.cqvip.innocence.framework.jwt;

import java.util.HashMap;

/**
 * @ClassName JwtClaims
 * @Description 为了方便统一管理存入token中的用户信息，
 * 这里统一规定一个类，用于存储需要放到jwt中的信息
 * @Author Innocence
 * @Date 2022/5/7 16:45
 * @Version 1.0
 */
public class JwtClaims extends HashMap<String,Object> {

    private static final long serialVersionUID = 1991326667420622584L;

    public JwtClaims(String userKey,String userId,String userName){
        this.set(userKey,userId,userName);
    }

    private JwtClaims set(String userKey,String userId,String userName){
        this.setUserKey(userKey);
        this.setUserId(userId);
        this.setUserName(userName);
        return this;
    }

    private void setUserKey(String userKey) {
        this.put("userKey",userKey);
    }

    private void setUserId(String userId) {
        this.put("userId",userId);
    }

    private void setUserName(String userName) {
        this.put("userName",userName);
    }
}

